package banking;

// import banking.*; // 在同一包中的类可以相互引用，无需用import语句。

public class TestBanking {
    public static void main(String[] args) {
        Customer customer;
        Account account;
        // Create an account that can has a 500.00balance.

        System.out.println("Creating the customer Jane Smith."); // 说明要创建客户Jane Smith。
        customer = new Customer("Jane", "Smith", 18, "student"); // 利用customer类中含有四个参数（传参类型为（String，String，int，String））的构造方法构造一个新的实例对象。
        System.out.println("Creating her account with a 500.00 balance."); // 说明要创造她的账户并存入500.00元。
        customer.setAccount(new Account(500.00)); // 创造她的账户并存入500.00元。
        account = customer.getAccount(); // 将类中属性声明为Account对象。
        customer.setAge(19); // 调用方法修改实例对象年龄属性。
        // Perform some account transactions
        System.out.println("Withdraw 150.00: " + account.withdraw(150.00)); // 以下为对账户进行存取操作并打印。
        System.out.println("Deposit 22.50: " + account.deposit(22.50));
        System.out.println("Withdraw 47.62: " + account.withdraw(47.62));
        System.out.println("Withdraw 400.00: " + account.withdraw(400.00));
        // Print out the final account balance
        System.out.println("Customer[" + customer.getLastName() + "," + customer.getFirstName() + ","
                + customer.getAge() + "," + customer.getjob() + "] has a balance of" + account.getBalance()); // 打印用户的LastName，FirstName，Age等属性。
    }
}
